import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import VueSocketIO from 'vue-socket.io'
import SocketIO from 'socket.io-client'
Vue.config.productionTip = false

// 生成一个socket实例
const socket = new VueSocketIO({
	debug: false,
	connection: SocketIO('http://192.168.1.129:3000', {
		transports: ['websocket'],
		autoConnect: false,
	}),
})
Vue.use(socket)

// var socket = new WebSocket('ws://localhost:3000')
// socket.addEventListener('open', function(event) {
//   console.log('socket is open')
// })

// socket.addEventListener('message', function(event) {
//   console.log('Message from server', event.data)
// })
new Vue({
	router,
	store,
	render: (h) => h(App),
}).$mount('#app')
